<%@ page import="entity.hotel_room" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: a3502
  Date: 2022/4/28
  Time: 10:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>房间状态查询</title>
    <link rel="stylesheet" href="/hotelSystem/layui/css/layui.css"  media="all">
</head>
<body>
<%
    List<hotel_room> roomList = (ArrayList)request.getAttribute("roomList");
    String roomTip = (String)request.getAttribute("roomTip");
    if(roomTip!=null){
%>
        <h3><%=roomTip%></h3>
<%
    }else if (roomList==null){
        %>
        <h3>房间信息获取失败，请重试</h3>
        <%
    }else {
%>
<div class="layui-form">
    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>房间号</th>
            <th>房间类型</th>
            <th>房间价格</th>
            <th>房间状态</th>
        </tr>
        </thead>
        <%
            for(hotel_room hotel_room:roomList){
        %>
        <tbody>
        <tr>
            <td><%=hotel_room.getRoom_no()%></td>
            <td><%=hotel_room.getRoom_class()%></td>
            <td><%=hotel_room.getRoom_price()%></td>
            <td><%=hotel_room.getRoom_status().equals("0")?"空余":"客满"%>
                <%
                    if (hotel_room.getRoom_status().equals("0")) {
                %>
                <span class="layui-badge-dot layui-bg-green"></span>
                <%
                }else {
                %>
                <span class="layui-badge-dot"></span>
                <%
                    }
                %>
            </td>

        </tr>
        <%
            }
    }
        %>
        </tbody>
    </table>
</div>

<script src="/hotelSystem/layui/layui.js" charset="utf-8"></script>
</body>
</html>
